# -*- coding: utf-8 -*-
# @Time    :2022/1/12 21:57
# @AUTHOR  :MORAN
# @Email   :moran@maqu.com
# @File    :urls.py
# @Software:PyCharm
from django.urls import path
from rest_framework.routers import DefaultRouter

from .views import *

urlpatterns = [
    path('payment/<pk>/', PaymentViewSet.as_view({'get': 'retrieve'})),
    path('payment/', PaymentViewSet.as_view({'put': 'update'}))
]
router = DefaultRouter()  # 创建路由器
router.register('classification', ClassificationViewSet)
router.register('classifications', ClassificationStudentViewSet)
router.register('commodity', CommodityViewSet)
router.register('commoditys', CommodityStudentViewSet)
router.register('cart', ShoppingCartViewSet, basename='shoppingcart')
router.register('order', OrderViewSet, basename='order')
urlpatterns += router.urls
